home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / Oberon⁄F™ 1.2 / Preinstalled version / Obx / Docu / Wrappers (.txt) < prev   
Encoding:
Oberon Document  |  1995-08-10  |  3.0 KB  |  53 lines  |  [oODC/obnF]

  1. Documents.StdDocumentDesc
  2. Documents.DocumentDesc
  3. Containers.ViewDesc
  4. Views.ViewDesc
  5. Stores.StoreDesc
  6. Documents.ModelDesc
  7. Containers.ModelDesc
  8. Models.ModelDesc
  9. Stores.ElemDesc
  10. TextViews.StdViewDesc
  11. TextViews.ViewDesc
  12. TextModels.StdModelDesc
  13. TextModels.ModelDesc
  14. TextModels.AttributesDesc
  15. Helvetica
  16. Helvetica
  17. DevCommanders.StdViewDesc
  18. DevCommanders.ViewDesc
  19. Helvetica
  20. Controls.FieldDesc
  21. Controls.ControlDesc
  22. TextCmds.find.find
  23. StdLinks.LinkDesc
  24. StdCmds.OpenDoc('Obx/Mod/Wrappers')
  25. Helvetica
  26. Oberon by Example: ObxWrappers
  27. This example implements a wrapper. Wrappers are views which contain other views but don't have their own models. In particular, a wrapper may have the same size as the view(s) that it wraps. In this way, it can combine its own functionality with that of the wrapped view(s).
  28. For example
  29. - a debugging wrapper may list the messages received by the wrapped view into the log
  30. - a background wrapper may add a background color, over which its wrapped view is drawn (which typically has no background color, i.e. which has a transparent background)
  31. - a layer wrapper may contain several layered views, e.g. a graph view overlaid by a caption view
  32. - a terminal wrapper which contains a terminal session and wraps a standard text view
  33. - a bundling wrapper which filters out controller messages, such that the wrapped view becomes read-only
  34. etc., the sky's the limit! Wrappers demonstrate the power of composition, i.e. how functionality of different objects can be combined in a very simple manner, without having to use complex language mechanisms such as (multiple) inheritance.
  35. Our example wrapper simply echoes every key typed in to the log.
  36.  ObxWrappers.Wrap    (* select view (singleton) before calling this command *)
  37.  ObxWrappers.Unwrap    (* select view (singleton) before calling this command *)
  38.     (* <== for example, select this view *)
  39. and then type in some characters, and see what happens in the log.
  40. ObxWrappers
  41. sources
  42. TextControllers.StdCtrlDesc
  43. TextControllers.ControllerDesc
  44. Containers.ControllerDesc
  45. Controllers.ControllerDesc
  46. TextRulers.StdRulerDesc
  47. TextRulers.RulerDesc
  48. TextRulers.StdStyleDesc
  49. TextRulers.StyleDesc
  50. TextRulers.AttributesDesc
  51. Helvetica
  52. Documents.ControllerDesc
  53.